From 14d89699f416d5bb5a75d5e31f93a68dce38962c Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Sat, 28 Apr 2007 09:44:24 +0100 Subject: [PATCH] vnet: Another build fix for finding Linux build tree and version. Signed-off-by: Robert Valentan --- tools/vnet/vnet-module/00README | 4 ++-- tools/vnet/vnet-module/Makefile.ver | 16 ++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/tools/vnet/vnet-module/00README b/tools/vnet/vnet-module/00README index 651164ca9f..707b965f08 100644 --- a/tools/vnet/vnet-module/00README +++ b/tools/vnet/vnet-module/00README @@ -9,8 +9,8 @@ can be set in your env or on the make command line: LINUX_SERIES: linux release to compile for: 2.4, or 2.6 (default). XEN_ROOT: root of the xen tree containing kernel source. KERNEL_VERSION: kernel version, default got from XEN_ROOT. -KERNEL_MINOR: kernel minor version, default -xen0. -KERNEL_SRC: path to kernel source, default linux- under XEN_ROOT. +KERNEL_SRC: path to kernel source, default build-linux- + under XEN_ROOT. *) For 2.4 kernel diff --git a/tools/vnet/vnet-module/Makefile.ver b/tools/vnet/vnet-module/Makefile.ver index 76382c2a32..dcd6e0f736 100644 --- a/tools/vnet/vnet-module/Makefile.ver +++ b/tools/vnet/vnet-module/Makefile.ver @@ -18,14 +18,7 @@ # 59 Temple Place, suite 330, Boston, MA 02111-1307 USA #============================================================================ -include $(XEN_ROOT)/Config.mk - LINUX_SERIES?=2.6 -ifeq ($(XEN_SPLIT_KERNEL),y) - KERNEL_MINOR=-xen0 -else - KERNEL_MINOR=-xen -endif LINUX_VERSION?=$(shell (/bin/ls -d $(XEN_ROOT)/pristine-linux-$(LINUX_SERIES).* 2>/dev/null) | \ sed -e 's!^.*linux-\(.\+\)!\1!' ) @@ -34,16 +27,19 @@ ifeq ($(LINUX_VERSION),) $(error Kernel source for linux $(LINUX_SERIES) not found) endif -KERNEL_VERSION=$(LINUX_VERSION)$(KERNEL_MINOR) +KERNEL_VERSION?=$(shell (/bin/ls -d $(XEN_ROOT)/build-linux-$(LINUX_VERSION)-xen* 2>/dev/null) | \ + grep -v -m 1 -e '-xenU' | \ + sed -e 's!^.*linux-\(.\+\)!\1!' ) -KERNEL_SRC ?= $(shell cd $(XEN_ROOT)/build-linux-$(KERNEL_VERSION)_$(XEN_TARGET_ARCH) && pwd) +KERNEL_SRC ?= $(XEN_ROOT)/build-linux-$(KERNEL_VERSION) ifeq ($(KERNEL_SRC),) $(error Kernel source for kernel $(KERNEL_VERSION) not found) endif # Get the full kernel release version from its makefile, as the source path -# may not have the extraversion, e.g. linux-2.6.12-xen0 may contain release 2.6.12.6-xen0. +# may not have the extraversion, e.g. linux-2.6.12-xen0 may contain release +# 2.6.12.6-xen0. KERNEL_RELEASE=$(shell make -s -C $(KERNEL_SRC) kernelrelease) KERNEL_MODULE_DIR=/lib/modules/$(KERNEL_RELEASE)/kernel -- 2.30.2